import express from "express";
import { formatResponse } from "../../utils/tools";
import { WeChatyService } from "../../services/weChaty/WeChatyService";
const router = express.Router();

/**
 * 获取登录url
 */
router.get("/codeUrl", async (_req: any, res) => {
  const result = await WeChatyService.getLoginUrl();
  res.send(formatResponse<any>(result));
});

/**
 * 获取登录信息
 */
router.get("/status", async (_req: any, res) => {
  const result = await WeChatyService.getLoginStatus();
  res.send(formatResponse<any>(result));
});

export default router;
